<template>
  <a-modal
    title="详情通道配置参数"
    :maskClosable="false"
    :width="1050"
    placement="right"
    :closable="true"
    @cancel="onClose"
    :footer="null"
    :visible="pDstChannelCfgInfoVisiable"
  >
    <a-form :form="form">
      <a-row>
        <a-col :md="12" :sm="24">
          <a-form-item label="通道标识" v-bind="formItemLayout">
            <a-input :disabled="true" v-decorator="['dstChannelName']" />
            <a-input
              hidden="true"
              v-decorator="['dstChannelId']"
            /> </a-form-item
        ></a-col>
        <a-col :md="12" :sm="24"
          ><a-form-item label="通道类型" v-bind="formItemLayout">
            <a-input
              :disabled="true"
              v-decorator="['dstChannelType']"
            /> </a-form-item
        ></a-col>
      </a-row>
      <a-row>
        <a-col :md="12" :sm="24"
          ><a-form-item
            :disabled="true"
            label="通道类型描述"
            v-bind="formItemLayout"
          >
            <a-input v-decorator="['dstChannelTypeDesc']" /> </a-form-item
        ></a-col>
        <a-col :md="12" :sm="24"
          ><a-form-item label="渠道号" v-bind="formItemLayout">
            <a-input
              :disabled="true"
              v-decorator="['channelNo']"
            /> </a-form-item
        ></a-col>
      </a-row>
      <a-row>
        <a-col :md="12" :sm="24"
          ><a-form-item label="服务商商户号" v-bind="formItemLayout">
            <a-input
              :disabled="true"
              v-decorator="['providerMchntNo']"
            /> </a-form-item
        ></a-col>
        <a-col :md="12" :sm="24"
          ><a-form-item label="主APPID" v-bind="formItemLayout">
            <a-input :disabled="true" v-decorator="['appId']" /> </a-form-item
        ></a-col>
      </a-row>
      <a-row>
        <a-col :md="12" :sm="24">
          <a-form-item label="子APPID" v-bind="formItemLayout">
            <a-input :disabled="true" v-decorator="['subAppId']" /> </a-form-item
        ></a-col>
      </a-row>
    </a-form>
  </a-modal>
</template>
<script>
import { mapState, mapMutations } from "vuex";

const formItemLayout = {
  labelCol: { span: 6 },
  wrapperCol: { span: 8 },
};

export default {
  name: "PDstChannelCfgInfo",
  props: {
    pDstChannelCfgInfoVisiable: {
      default: false,
    },
  },
  data() {
    return {
      formItemLayout,
      form: this.$form.createForm(this),
      roleData: [],
      userId: "",
      loading: false,
    };
  },
  computed: {
    ...mapState({
      currentUser: (state) => state.account.user,
    }),
  },
  methods: {
    ...mapMutations({
      setUser: "account/setUser",
    }),
    onClose() {
      this.loading = false;
      this.form.resetFields();
      this.$emit("close");
    },
    setFormValues({ ...list }) {
      let fields = [
        "dstChannelName",
        "dstChannelType",
        "dstChannelTypeDesc",
        "channelNo",
        "providerMchntNo",
        "appId",
        "subAppId",
      ];
      Object.keys(list).forEach((key) => {
        if (fields.indexOf(key) !== -1) {
          this.form.getFieldDecorator(key);
          let obj = {};
          obj[key] = list[key];
          this.form.setFieldsValue(obj);
        }
      });
    },
  },
  watch: {},
};
</script>
